package com.buddy.demo.spring.schedule;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class SpringScheduleFixDelay {

//    @Scheduled(fixedDelay = 1_000L)
//    public void fixedTest() throws InterruptedException {
//        System.out.println(Thread.currentThread().getName());
//        System.out.println("Thread1=>"+LocalDateTime.now());
//        // 只有一个线程，并且是在当前 thread 后执行
//        Thread.sleep(2000);
//
//    }


}
